home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 38
/
038.d81
/
tinted tiles
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
105 lines
0 gosub720:clr
10 dima$(16):dime(16):dimc(5,5)
20 ct=1:poke 53280,.:poke53281,.
30 print"[147][158] tinted tiles"
31 print" by joel epstein"
32 print" p [154]- play tinted tiles"
34 print" q [154]- quit"
36 print" press p [154]or q[154]."
37 a=peek(203):ifa<>41anda<>62then37
38 ifa=62thengosub60000:goto36
39 print" please wait -- scrambling tiles"
40 a$(16)="[144] [157][157][157] [157][157][157] [145][145]"
50 a$(1)=" [157][157][157] a [157][157][157] [145][145]"
60 a$(2)=" [157][157][157] b [157][157][157] [145][145]"
70 a$(3)="[159] [157][157][157] c [157][157][157] [145][145]"
80 a$(4)="[156] [157][157][157] d [157][157][157] [145][145]"
90 a$(5)=" [157][157][157] e [157][157][157] [145][145]"
100 a$(6)=" [157][157][157] f [157][157][157] [145][145]"
110 a$(7)="[158] [157][157][157] g [157][157][157] [145][145]"
120 a$(8)="[129] [157][157][157] h [157][157][157] [145][145]"
130 a$(9)="[149] [157][157][157] i [157][157][157] [145][145]"
140 a$(10)="[150] [157][157][157] j [157][157][157] [145][145]"
150 a$(11)="[151] [157][157][157] k [157][157][157] [145][145]"
160 a$(12)="[152] [157][157][157] l [157][157][157] [145][145]"
170 a$(13)="[153] [157][157][157] m [157][157][157] [145][145]"
180 a$(14)="[154] [157][157][157] n [157][157][157] [145][145]"
190 a$(15)="[155] [157][157][157] o [157][157][157] [145][145]"
195 fora=1to15:e(a)=.:next:z=0
200 fora=1to4:forb=1to4
210 c(a,b)=int(rnd(0)*16)
220 ford=0to15
230 if e(d)=c(a,b) then 210
240 next d
250 e(z)=c(a,b):z=z+1
260 if z=15 then goto280
270 nextb:nexta
280 print
290 c(4,4)=16
300 poke 53280,6:print"[147][158] tinted tiles"
305 print" by joel epstein"
306 print" press letter of tile you wish to move."
307 print"[154] press q [154]to quit."
310 print"";
320 fora=1to4:forb=1to4
330 g=c(a,b):printa$(g);
340 nextb:print:print:print:print"";:nexta:poke198,.
350 print" [154]number of moves:"ct-1
360 get qq$:ifqq$=""then360
370 ifqq$="q"orqq$="[209]"thengosub60100:if(ok)then20
400 h=(asc(qq$)-64)
410 if h<0 or h>15 then goto 350
420 fora=1to4:forb=1to4
430 if c(a,b)=h then goto 460
440 nextb:nexta
450 goto350
460 ifc(a+1,b)=16thenc(a+1,b)=h:c(a,b)=16:goto510
470 ifc(a-1,b)=16thenc(a-1,b)=h:c(a,b)=16:goto510
480 ifc(a,b+1)=16thenc(a,b+1)=h:c(a,b)=16:goto510
490 ifc(a,b-1)=16thenc(a,b-1)=h:c(a,b)=16:goto510
500 goto350
510 print"";
520 fora=1to4:forb=1to4
530 g=c(a,b):printa$(g);
540 nextb:print:print:print:print"";:nexta
550 ct=ct+1
560 jj=1
570 fora=1to4:forb=1to4
580 ifc(a,b)<>jj then goto 350
590 jj=jj+1
600 nextb:nexta
610 print"[154] hooray!! you won in only"ct-1"[154]moves"
630 print" [154]press space [154]to return to menu"
640 ifpeek(203)<>60then640
650 goto20
690 fora=1to4:forb=1to4:c(a,b)=0:nextb:nexta
700 if qq$="*" then print"sorry, but you lost":print"in";ct-1;"moves"
710 ct=1:forxx=0to15:e(xx)=0:nextxx:g=0:jj=0:h=0:z=0:forf=1to1500:next:goto65535
720 poke53280,14:poke53281,14
730 printchr$(142)"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
740 fora=1to23:print"[221]"spc(38)"[221]";:next
750 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][157][148][192]"
760 fora=217to242:pokea,peek(a)or128:next
770 print" loadstar presents:"
780 print" "
790 print" tinted tiles "
800 print" "
810 print" by joel epstein "
820 print" "
830 print" copyright 1987 "
840 print" "
850 print" "
860 print" press space to continue"
870 ifpeek(203)<>60then870
880 return
60000 print"[145] [154]are you sure you want to quit? (y[154]/n[154])"
60010 a=peek(203):ifa<>25anda<>39then60010
60020 ifa=39thenprint"[145] [145]":return
60030 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
60040 ifer<>63thenend
60050 load"hello connect",8
60100 print" [154]are you sure you want to quit? (y[154]/n[154])"
60110 a=peek(203):ifa<>25anda<>39then60110
60120 ok=.:ifa=39thenprint"[145] [154]press q[154] to quit. ":return
60130 ok=1:return